/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
//import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author Ekaterina
 */

@Entity
@Table (name = "address", catalog = "otdelkadrov", schema = "") 
public class Address implements Serializable {
  
@Column(name = "oblast")
private String oblast;
      
 @Column(name = "gorod")
private String gorod;
        
 @Column(name = "rayon")
private String rayon;
          
 @Column(name = "street")
private String street;
            
 @Column(name = "dom")
private int dom;
              
 @Column(name = "flat")
private int flat;
                
  @Column(name = "phone")
private String phone;
                  
  @Column(name = "indexx")
private int indexx;
                    
 @Column(name = "type")
private String type;
 
 @Id
@GeneratedValue
@Column (name="id")
private Integer id = null;

//@OneToOne
//private Worker worker;

  @ManyToOne
    @JoinColumn(name = "worker",referencedColumnName = "id")
    private Worker worker;
 
    public String getOblast() {
        return oblast;
    }

    public String getGorod() {
        return gorod;
    }

    public String getRayon() {
        return rayon;
    }

    public String getStreet() {
        return street;
    }

    public int getDom() {
        return dom;
    }

    public int getFlat() {
        return flat;
    }

    public String getPhone() {
        return phone;
    }

    public int getIndexx() {
        return indexx;
    }

    public String getType() {
        return type;
    }

    public Integer getId() {
        return id;
    }

    public Worker getWorker() {
        return worker;
    }

    public void setOblast(String oblast) {
        this.oblast = oblast;
    }

    public void setGorod(String gorod) {
        this.gorod = gorod;
    }

    public void setRayon(String rayon) {
        this.rayon = rayon;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    public void setDom(int dom) {
        this.dom = dom;
    }

    public void setFlat(int flat) {
        this.flat = flat;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public void setIndexx(int indexx) {
        this.indexx = indexx;
    }

    public void setType(String type) {
        this.type = type;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public void setWorker(Worker worker) {
        this.worker = worker;
    }


    
}
